package com.ruoyi.web.controller.persion.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.web.controller.persion.entity.Favorite ;
import com.ruoyi.web.domain.BT.TorrentFilesEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface FavoriteMapper extends BaseMapper<Favorite> {
    Favorite selectFavoriteById(Long favoriteId);

    @Select("select * from user_favorite_seed where user_id = #{userId}")
    List<Favorite> selectFavoriteList(int userId);
    
    int insertFavorite(Favorite favorite);
    
    int updateFavorite(Favorite favorite);
    
    int deleteFavoriteById(Long favoriteId);
    
    int deleteFavoriteByIds(Long[] favoriteIds);
    
    // 检查是否已收藏
    int checkFavoriteExists(Long userId, Long seedId);
    
    // 根据用户ID获取收藏列表
    List<Favorite> selectFavoritesByUserId(Long userId);
}